<template>
  <div class="icon_item" @click="go">
    <div class="icon">
      <img :src="src" alt="">
    </div>
    <div class="text">{{ text }}</div>
  </div>
</template>

<script setup lang='ts'>
import router from '@/router';
import { showToast } from 'vant';

import { ref } from 'vue';
const props = defineProps({
  src: {
    type: String,
    default: () => { }
  },
  text: {
    type: String,
    default: ''
  },
  link: {
    type: String,
    default: ''
  },
  isOpen: {
    type: Boolean,
    default: true
  }
})
function go() {
  if (!props.isOpen) {
    showToast('功能暂未开放!');
    return
  }
  router.push(props.link)
}
</script>

<style lang='less' scoped>
.icon_item {
  .icon {
    img {
      width: 36px;
      height: 36px;

    }
  }

  .text {
    font-size: 12px;
    font-family: PingFangSC-Regular,
      PingFang SC;
    font-weight: 400;
    color: #0D1722;
    text-align: center;
  }
}
</style>